<template>
  <q-dialog v-model="show" persistent>
    <q-card class="dialog-content" style="min-width: 600px; max-height: 500px">
      <q-card-section class="dialog-title bg-primary" >
        <div class="text-center text-white dialog-title">
          <q-btn
            style="font-size: 18px;color: white"
            flat round dense
            class="iconfont icontubiao-67 white close-btn dialog"
            @click="$emit('close')"
          />
          <span class="font-size-16">
            公告
          </span>
        </div>
      </q-card-section>
      <q-card-section style="padding: 0 20px 10px;height: 400px" class="scroll scrollbar">
        <div class="font-size-16 text-center margin-t-20 margin-b-20">{{title}}</div>
        <div style="max-width: 100%;max-height: 600px" v-html="detail"></div>
      </q-card-section>
    </q-card>
  </q-dialog>
</template>

<script>
import { getNoticeNewsDetail } from '../../../boot/home/home-new'

export default {
  name: 'notice-detail',
  props: {
    show: {
      type: Boolean,
      default: false,
      required: true
    }
  },
  data () {
    return {
      title: '',
      detail: '',
      selIndex: null
    }
  },
  methods: {
    initData (id, title, index) {
      this.title = title
      getNoticeNewsDetail(id).then(res => {
        if (res.data.read) {
          console.log(index, '已读')
          this.$emit('readNotice', index)
        }
        this.detail = res.data.content
      })
    }
  }
}
</script>

<style scoped>

</style>
